/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.diego.game.sudoku.design;

import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.TiledLayer;



/**
 * @author diego
 */
public class GameDesign {

    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private Image sudoku_tiles;
    private TiledLayer nivel1;
    private TiledLayer nivel2;
    //</editor-fold>//GEN-END:|fields|0|

    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|

    public Image getSudoku_tiles() throws java.io.IOException {//GEN-BEGIN:|1-getter|0|1-preInit
        if (sudoku_tiles == null) {//GEN-END:|1-getter|0|1-preInit
            // write pre-init user code here
            sudoku_tiles = Image.createImage("/sudoku_tiles.png");//GEN-BEGIN:|1-getter|1|1-postInit
        }//GEN-END:|1-getter|1|1-postInit
        // write post-init user code here
        return this.sudoku_tiles;//GEN-BEGIN:|1-getter|2|
    }
//GEN-END:|1-getter|2|



    public TiledLayer getNivel1() throws java.io.IOException {//GEN-BEGIN:|3-getter|0|3-preInit
        if (nivel1 == null) {//GEN-END:|3-getter|0|3-preInit
            // write pre-init user code here
            nivel1 = new TiledLayer(9, 9, getSudoku_tiles(), 32, 32);//GEN-BEGIN:|3-getter|1|3-midInit
            int[][] tiles = {
                { 18, 13, 19, 10, 19, 11, 19, 14, 17 },
                { 15, 19, 19, 19, 14, 19, 19, 19, 13 },
                { 19, 19, 11, 13, 19, 12, 10, 19, 19 },
                { 19, 11, 19, 19, 19, 19, 19, 15, 19 },
                { 14, 19, 19, 19, 30, 19, 13, 19, 10 },
                { 19, 15, 19, 19, 19, 19, 19, 17, 19 },
                { 19, 19, 10, 15, 19, 17, 16, 19, 19 },
                { 16, 19, 19, 19, 13, 19, 19, 19, 12 },
                { 13, 12, 19, 14, 19, 18, 19, 10, 11 }
            };//GEN-END:|3-getter|1|3-midInit
            // write mid-init user code here
            for (int row = 0; row < 9; row++) {//GEN-BEGIN:|3-getter|2|3-postInit
                for (int col = 0; col < 9; col++) {
                    nivel1.setCell(col, row, tiles[row][col]);
                }
            }
        }//GEN-END:|3-getter|2|3-postInit
        // write post-init user code here
        return nivel1;//GEN-BEGIN:|3-getter|3|
    }
//GEN-END:|3-getter|3|







    public TiledLayer getNivel2() throws java.io.IOException {//GEN-BEGIN:|8-getter|0|8-preInit
        if (nivel2 == null) {//GEN-END:|8-getter|0|8-preInit
            // write pre-init user code here
            nivel2 = new TiledLayer(9, 9, getSudoku_tiles(), 32, 32);//GEN-BEGIN:|8-getter|1|8-midInit
            int[][] tiles = {
                { 19, 13, 19, 19, 19, 19, 19, 17, 19 },
                { 18, 19, 19, 19, 13, 19, 19, 12, 19 },
                { 19, 19, 19, 19, 10, 17, 14, 19, 18 },
                { 19, 19, 19, 19, 19, 14, 13, 11, 19 },
                { 19, 19, 19, 19, 19, 19, 19, 19, 19 },
                { 19, 10, 18, 17, 19, 19, 19, 19, 19 },
                { 15, 19, 10, 16, 12, 19, 19, 19, 19 },
                { 12, 14, 19, 19, 15, 19, 19, 19, 16 },
                { 19, 11, 19, 19, 19, 19, 19, 10, 19 }
            };//GEN-END:|8-getter|1|8-midInit
            // write mid-init user code here
            for (int row = 0; row < 9; row++) {//GEN-BEGIN:|8-getter|2|8-postInit
                for (int col = 0; col < 9; col++) {
                    nivel2.setCell(col, row, tiles[row][col]);
                }
            }
        }//GEN-END:|8-getter|2|8-postInit
        // write post-init user code here
        return nivel2;//GEN-BEGIN:|8-getter|3|
    }
//GEN-END:|8-getter|3|

}
